define([

],function(){
    return function(num,index){
       console.log(num,index);
       var index = parseInt(index)
       var num = parseInt(num)
        document.querySelector(".span").innerHTML = ""
        var str = "";
        debugger;
   for(var i=0; i<5; i++){
        if(index-3 >= 0 && index+4 <num ){
            str +='<span class="'+(index === index-2+i?"gao":"")+'">'+(index-2+i)+'</span>'
        }else if(index+4 >= num){
            str +='<span  class="'+(index === num-4+i?"gao":"")+'">'+(num-4+i)+'</span>'
        }else{
            str +='<span  class="'+(index === i+1?"gao":"")+'">'+(1+i)+'</span>'
        }


    }
    if(index+4 < num){
        str +='<span>......</span><span>'+num+'</span>'
    }
    document.querySelector(".span").innerHTML =str
  

    }
})